home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
castools.zip
/
FAX.H
< prev
next >
Wrap
Text File
|
1990-01-05
|
6KB
|
158 lines
/* FAX.H Header file for the CAS Toolkit high-level functions. =============
Defines structures and constants used in Intel/DCA Communicating
Applications Specification 1.0 Toolkit.
This file, as well as FAXGLOB.H, must be included in any application
source files that use CAS Toolkit functions whose names begin with FAX-.
Applications that use only the Toolkit functions that begin with CAS- need
only include the header file CAS.H.
==============================================================================*/
/*
FILE TRANSFER RECORD LIST structure: This is a component of the
high-level structure ECS that is input to function FAXSubmitTask. The ECS
structure is also used by functions FAXSend, FAXCopyECS and FAXFreeECS.
This File Transfer Record List structure is itself the output of function
FAXGetEventFileInfo.
*/
typedef struct FTRLIST {
FTR OneFTR; /* A File Transfer Record */
struct FTRLIST *next; /* Connector for linked list */
} FTRLIST;
/*
FILE LIST structure: Input to functions FAXSend and FAXSubmitTask.
*/
typedef struct FILELIST{
char FileName[80]; /* Complete ASCII path and name of file */
BYTE FileType; /* ASCII, PCX, or DCX, relevant only for Fax */
struct FILELIST *next; /* next file in list */
} FILELIST;
/*
EVENT CONTROL structure: Input to function FAXSubmitTask. Also used by
functions FAXSend, FAXCopyECS and FAXFreeECS.
This Event Control Structure is also the output from function
FAXGetEventControlInfo.
*/
typedef struct ECS{
ECF EventControlFile; /* CAS Task Control File */
char *CoverPageText; /* Variable length optional cover */
FTRLIST *FirstFTR; /* List of File Transfer Records */
} ECS;
/*
DEFAULT Event Control Structure and File Transfer Record, defined with
initial values in FAXDFLTS.H.
*/
extern FTRLIST DefaultsFTRL;
extern ECS DefaultsECS;
/* ERROR HANDLING */
/*
Error Table structure: A mapping of the CAS error codes with appropriate
messages and CAS error classes.
*/
typedef struct {
int errorcode;
char *msg;
int errorclass;
} ErrorTable;
/* Error Message structures defined in FAXERROR.H */
extern char *FAXerrlist[];
extern ErrorTable CASerrors[];
/* Global variables */
extern int FAXerrno;
extern int CASerrorcode;
/* Error Constants */
#define MSGLENGTH 80 /* The maximum error message size */
#define CASnerrors 55 /* The # of entries in CASerrors[] */
#define SUCCESS 1
#define FAIL 0
/* CAS Error Classes */
#define FAXWARNING 0
#define DOSWARNING 1
#define FATALERROR 2
#define FATALDOSERROR 3
#define FAXERROR 4
/* Additional Toolkit Error Classes */
#define TOOLKITERROR 6
#define UNKNOWNCASERROR 7
#define NOERROR 8
/* Values of Toolkit error variable FAXerrno */
#define LSEEKERROR 23
#define OUTOFMEMORY 24
#define CANTOPENFILE 25
#define CANTWRITEFILE 26
#define CANTREADFILE 27
#define CANTCLOSEFILE 28
#define BADFILECOUNT 29
#define ORPHANWARNING 30
#define EVENTNOTFOUND 31
#define FILECOUNTOUTOFRANGE 32
#define NOTTHATMANYFILES 33
#define EVENTWASCURRENT 34
#define BADSTATUS 35
#define LOSTFTRS 36
#define UNEXPECTEDEOF 37
#define MOREFTRSTHANFC 38
#define STRINGTOOLONG 39
#define INVALIDPTR 40
#define BADEVENTTYPE 41
#define BADTRANSFERTYPE 42
#define FIELDZEROED 43
#define BADEVENTTIME 44
#define BADEVENTDATE 45
#define BADPHONENUMBER 46
#define NONASCIISTRING 47
#define BADSENDCOVER 48
#define FTRFIELDZEROED 49
#define FTRBADFILETYPE 50
#define FTRBADTEXTSIZE 51
#define FTRBADPAGELENGTH 52
#define FTRNONASCIISTRING 53
#define RESERVEDFIELDZEROED 54
#define FTRRESERVEDZEROED 55
#define FTRBADPAGEINCREMENTS 56
#define LOGOFILENOTFOUND 57
#define FILETOSENDNOTFOUND 58
#define INVALIDDEFAULTS 59
#define INVALIDECS 60
#define NOCOVERTEXT 61
#define EVENTISCURRENT 62
#define RECEIVEDFAXNOCOVER 63
#define LASTMESSAGE 64
/* CAS Toolkit function prototypes */
extern int pascal FAXSend(char *To, char *PhoneNumber, FILELIST *files, CAS_DATE *date, CAS_TIME *time);
extern int pascal FAXSubmitTask(ECS *TaskSettings, char *To, char *PhoneNumber, FILELIST *files, CAS_DATE *date, CAS_TIME *time);
extern ECS * pascal FAXCopyECS(ECS *SourceECS, ECS *CopyECS);
extern int pascal FAXFreeECS(ECS *SourceECS);
extern int pascal FAXCancelTask(int EventHandle);
extern ECF * pascal FAXGetEventControlInfo(int EventHandle, BYTE *queue, ECF *EventInfo);
extern char * pascal FAXGetEventCover(int EventHandle, BYTE *queue, char *CoverPtr);
extern FTRLIST * pascal FAXGetEventFileInfo(int EventHandle, BYTE *queue, FTRLIST *FTRs, int WhichFTRFirst, int *HowManyFTRs);
/* Error handling function prototype */
extern char * pascal FAXError(char *MessageIn, char *MessageOut, int *ErrorClass);
/* Utility function prototypes */
extern int pascal SubmitSingleOk(ECS *task);
extern int pascal ECSOkToSubmit(ECS *ecs);
extern int pascal SFTROkToSubmit(SFTR *sftr);
extern int pascal FTRLOkToSend(ECS *ecs, FTRLIST *ftrl);
extern void pascal free_FTRLIST(FTRLIST *ftrl);
extern void pascal freeup(ECS *ecs);
extern int pascal ValidTime(CAS_TIME *time);
extern int pascal ValidDate(CAS_DATE *date);